import request from '@/utils/request'

// 查询柜组列表
export function listCabinetGroup(query) {
  return request({
    url: '/cabinetGroup/list',
    method: 'post',
    params: query
  })
}

// 查询柜组详细
export function getCabinetGroup(id) {
  return request({
    url: '/cabinetGroup/' + id,
    method: 'get'
  })
}

// 新增柜组 和修改
export function saveCabinetGroup(data) {
  return request({
    url: '/cabinetGroup/save',
    method: 'post',
    data: data
  })
}

// 批量更新智能柜组编号
export function batchUpdateGroup(data) {
  return request({
    url: '/smartCabinet/batchUpdateGroup',
    method: 'post',
    data: data
  })
}

// 批量更新智能区域
export function batchUpdateRegion(data) {
  return request({
    url: '/smartCabinet/batchUpdateRegion',
    method: 'post',
    data: data
  })
}

// 批量更新数微智能柜组编号
export function batchUpdateGroupToShuwei(data) {
  return request({
    url: '/terminal/batchUpdateGroup',
    method: 'post',
    data: data
  })
}
// 批量更新数微智能区域
export function batchUpdateRegionToShuwei(data) {
  return request({
    url: '/terminal/batchUpdateRegion',
    method: 'post',
    data: data
  })
}


// 获取所有柜组
export function cabinetGroupGetAll() {
  return request({
    url: '/cabinetGroup/getAll',
    method: 'get'
  })
}

// 删除柜组
export function delCabinetGroup(ids) {
  return request({
    url: '/cabinetGroup/remove' ,
    method: 'post',
    data: ids
  })
}
